package nodes.binary;

import nodes.AbstractNode;
import nodes.ConstantNode;
import model.Model;

/**
 * Used for representing exponentiation in the expression tree
 * 
 * @author Andrew Patterson
 */
public class ExponentNode extends AbstractBinaryNode
{

    public ExponentNode (Model model)
    {
        super(model);
        myName = syntaxBundle.getString("exponentiation_label");
    }

    public AbstractNode evaluate ()
    {
        return new ConstantNode((int) Math.pow(myLeft.evaluate().getValue(),myRight.evaluate().getValue()));
    }

}
